﻿using EAS.Common.Players;
using Terraria;
using Terraria.GameContent.Creative;
using Terraria.ID;
using Terraria.ModLoader;

namespace EAS.Content.Items
{
    public class FlowerFlower : ModItem
    {
        public override void SetStaticDefaults()
        {
            CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
        }

        public override void SetDefaults()
        {
            Item.width = 20;
            Item.height = 44;
            Item.accessory = true;
            Item.rare = ItemRarityID.LightRed;
        }

        public override void AddRecipes()
        {
            Recipe recipe = CreateRecipe(1);
            recipe.AddIngredient(ItemID.ManaFlower, 1);
            recipe.AddIngredient(ModContent.ItemType<LifeFlower>(), 1);
            recipe.AddTile(TileID.TinkerersWorkbench);
            recipe.Register();
        }

        public override void UpdateAccessory(Player player, bool hideVisual)
        {            
            player.manaFlower = true;
            player.endurance += 0.08f;
            player.GetModPlayer<AccPlayer>().lifeFlower = true;
            player.manaCost -= 0.08f;
        }
    }
}
